#include <stdio.h>
#define k 2

int main() {
	int a[4][3], m, n, t;
	for (m = 0; m < 4; m++)
		for (n = 0; n < 3; n++) {
			scanf("%d", &a[m][n]);
		}
	printf("The array before moving:\n");
	for (m = 0; m < 4; m++) {
		for (n = 0; n < 3; n++) {
			printf("%d\t", a[m][n]);
		}
		printf("\n");
	}
	for (m = 0; m < 4; m++) {
		if (m == k)
			for (n = 0; n < 3; n++) {
				t = a[m][n];
				a[m][n] = a[0][n];
				a[0][n] = t;
			}
	}
	printf("The array after moving:\n");
	for (m = 0; m < 4; m++) {
		for (n = 0; n < 3; n++)
			printf("%d\t", a[m][n]);
		printf("\n");
	}
}